﻿
function TinyMceValidatorEvalulateIsValid(val) {

    if (tinymce) {

        var instance = tinymce.EditorManager.getInstanceById(val.controltovalidate);
        
        var value = instance.getContent();
        
        if (val.isrequired == "true" && value == val.initialvalue.toString())
            return false;

        if ((val.minimumlength > 0 && value.length < val.minimumlength) || (val.maximumlength > 0 && value.length > val.maximumlength))
            return false;

        return true;
        
    }
    
}